/**
 * $Id: SyncBussinessDataThread.java,v 1.2 2006/08/07 08:24:09 star Exp $
 *
 * Copyright 2006 Skyinfo, Inc. All Rights Reserved.
 */
package com.haoxi.gateway.runner.synchdata;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * TODO
 * 
 * Revision History
 * 
 * 2006-8-7,star.Zhao,created it
 */
public class SyncBussinessDataThread implements Runnable {
    private final static Log log = LogFactory
            .getLog(SyncBussinessDataThread.class);
    private boolean running = true;
    private int delay;
    private String gatewayCode;
    private String moblieStartWith;
    private int syncType;

    public SyncBussinessDataThread(int delay, int syncType, String gatewayCode,
            String moblieStartWith) {
        this.delay = delay;
        this.gatewayCode = gatewayCode;
        this.moblieStartWith = moblieStartWith;
        this.syncType = syncType;
    }

    public void run() {
        log.debug("SpecialMobileChgThread Thread start()!");
        while (running) {
            SyncBussinessDataMrg.getInstance().syncBussinessDataMth(
                    this.syncType, this.gatewayCode, this.moblieStartWith);
            
            // sleep
            try {
                Thread.sleep(delay);
            } catch (InterruptedException ite) {
                log.error("InterruptedException in SpecialMobileChgThread !",
                        ite);
            }

        }
    }

}
